// let arr = [1, 23, 4, 5, 6, 7, 8, 9, 21, 10];
    // function between(a, b) {
    //   return function(v) {
    //     return v >= a && v <= b;
    //   };
    // }
    // console.log(arr.filter(between(3, 9)));
    // let hd = arr.filter(function(v) {
    //   return v >= 2 && v <= 9;
    // });
    // console.log(hd);
    // let a = arr.filter(function(v) {
    //   return v >= 6 && v <= 10;
    // });
    // console.log(a);
    console.log('-----------------------\n')
  
    let lessons = [
      {
        title: "媒体查询响应式布局",
        click: 89,
        price: 12
      },
      {
        title: "FLEX 弹性盒模型",
        click: 45,
        price: 120
      },
      {
        title: "GRID 栅格系统",
        click: 19,
        price: 67
      },
      {
        title: "盒子模型详解",
        click: 29,
        price: 300
      }
    ];

    function between(a, b, filed="price") {
      return function(v) {
        return v[filed] >= a && v[filed] <= b;
      };
    }
    console.table(lessons.filter(between(10, 100)));
    console.table(lessons.filter(between(10, 30, 'click')));